home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_128 / paint / paint.w < prev    next >
Text File  |  1992-05-06  |  52KB  |  2,287 lines

  1.  
  2.    idnt  Paint
  3.  
  4.    section  one
  5.  
  6. 1. Paint a picture.
  7.    To assemble: web paint
  8.                 assem paint.a -o paint.o
  9.                 alink paint.o to paint
  10.                 delete paint.a
  11.                 delete paint.o
  12.                                     --- Greg Lee, July 22, 1986
  13.  
  14.    --Macro definitions for assembler
  15.    --EQU statements for assembler
  16.    --Definitions of library references
  17.  
  18.  
  19.    define  winheight     200
  20.    define  tot_height    400
  21.    define  winwidth      320
  22.    define  tot_width     640
  23.    define  canvas         10
  24.  
  25. 2. Here is where execution starts.
  26.  
  27. Main
  28.  
  29.       define   true   1
  30.       define   false  0
  31.       define   arg`a  D1.L
  32.       define   arg`b  D2.L
  33.       define   newline 10
  34.       define   push  -(SP).L
  35.       define   pop    (SP)+
  36.       define   chr    D0.B
  37.       define   wrd    D0.W
  38.       define   lng    D0.L
  39.       define   rtn    D0.L
  40.       define   adr    A0.L
  41.  
  42.    movem.l   command_tail/tail_length,-(sp)
  43.    --Begin from workbench
  44.    --Initialize standard input and output
  45.    movem.l   (sp)+,command_tail/tail_length
  46.  
  47.    --Get file name from input line
  48.    --Initialize the screen
  49.    --Set up basic colors
  50.  
  51.    print    howtoquit
  52.  
  53.  · without a delay, screen title tends to get written
  54.  · after page is erased
  55.    d0    =  100
  56.    {  push  =  d0
  57.       graph  WaitTOF
  58.       d0.l  =  pop
  59.       d0   -=  1
  60.       bne   }
  61.  
  62.    Erase the page, and draw the palette
  63.  
  64.    Make the pointer square
  65.  
  66.    --Load requested picture
  67.  
  68.       define   h_pos D6.L
  69.       define   v_pos D7.L
  70.    h_pos   =  0
  71.    v_pos   =  0
  72.  
  73.       byte    active_scroll
  74.  
  75. sleep
  76.    lng   =  signalid
  77.    callex   Wait
  78.    { adr   =  messageport
  79.      callex   GetMsg
  80.      --Answer it
  81.      ->  }
  82. .done
  83.    --Close the screen
  84.    --Back to workbench
  85.  
  86.    rtn  =  0
  87.  
  88.  
  89. --Begin from workbench
  90.       long  wb_message
  91.       define  pr_cli     172
  92.       define  pr_msgport  92
  93.  
  94.    a1.l -= a1
  95.    callex   FindTask
  96.    a4.l  =  d0
  97.    tst.l    pr_cli(a4)
  98.    bne   §
  99.    adr   =  ^pr_msgport(a4)
  100.    callex  WaitPort
  101.    adr   =  ^pr_msgport(a4)
  102.    callex  GetMsg
  103.    wb_message  =  d0
  104.  
  105.  
  106. --Back to workbench
  107.    tst.l  wb_message
  108.    beq   §
  109.    callex  Forbid
  110.    a1.l  =  wb_message
  111.    callex  ReplyMsg
  112.  
  113.  
  114. --Answer it
  115.    tst.l    rtn
  116.    = { tst.b  active_scroll
  117.        != { --Scroll the screen
  118.             tst.b  active_drag
  119.             beq   §
  120.        }
  121.        tst.b  active_drag
  122.        beq    sleep
  123.        --Drag the thing
  124.        ->   §
  125.    }
  126.    adr   =  rtn
  127.    push  = 20(adr)
  128.    wrd   = 24(adr)
  129.    push  = lng
  130.    a1.l  = adr
  131.    callex   ReplyMsg
  132.    lng   = pop
  133.    d1.l  = pop    · class
  134.    btst  #3,d1
  135.    != { --Process button command
  136.         ->  §
  137.    }
  138.    btst  #10,D1; beq §  · should not be possible
  139.  
  140.  · here it's a raw key message
  141.    chr  ?  #$45              · escape key?
  142.    beq   .done
  143.    --Process key command
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150. --Process button command
  151.       byte  curr_tool
  152.    chr  ?  #$69
  153.    = { active_drag  =  false
  154.        --Change tools
  155.        ->  §
  156.    }
  157.  
  158.    tst.b shifttool
  159.    != { chr  ?  #$68
  160.         = « active_drag  =  true »
  161.         chr  ?  #$E8
  162.         = « active_drag  = false »
  163.         ->  §
  164.    }
  165.  
  166.    tst.b spbar_flag
  167.    = { tst.b sptool
  168.        = { tst.b curr_tool
  169.            = { chr  ?  #$68
  170.                = { Make a box
  171.                }
  172.                ->  §
  173.            }
  174.        }
  175.    }
  176.  
  177.       byte  active_drag
  178.    chr  ?  #$68
  179.    = { Get mouse coordinates
  180.        d1.w  ?  17
  181.        <= { Select the palette color
  182.             ->  §
  183.        }
  184.  
  185.        tst.b  spbar_flag
  186.        != { tst.b  active_drag
  187.             != { tst.b sptool
  188.                  = « Draw a real line to here »
  189.             }
  190.        }
  191.        active_drag  =  true
  192.        adr  =  ^line.1pos
  193.        (adr)+.l = d0
  194.        (adr)+.l = d1
  195.        d2  =  -1
  196.        (adr).l  = d2
  197.        tst.b  sptool; bne §
  198.    · if spbar_flag AreaMove or AreaDraw (cf areapoints++)
  199.        tst.b  spbar_flag
  200.        != { adr  = ^areapoints
  201.             d2.w  = (adr); (adr).w += 1
  202.             tst.w  d2
  203.             = {  graphics AreaMove
  204.                  ->  §
  205.             }
  206.             graphics AreaDraw
  207.        }
  208.        ->  §
  209.    }
  210.  
  211.    chr  ?  #$E8
  212.    = {  tst.b  sptool
  213.     = {  tst.b  spbar_flag; bne §
  214.     }
  215.     tst.b  active_drag; beq §
  216.         active_drag  =  false
  217.     curr_tool  ?  1
  218.     = {  tst.b  sptool; beq §
  219.     }
  220.         Get mouse coordinates
  221.         d1.w  ?  17
  222.         > « Draw a real line to here »
  223. ·       ->  §
  224.    }
  225.  
  226.  
  227.  
  228. --Process key command
  229.  
  230.       define down_up D1.L
  231.    down_up  =  true
  232.    bclr  #7,chr; != « down_up  =  false »
  233.  
  234.       byte upwards
  235.       byte across
  236.  
  237.    chr  ?  #$4C   · up arrow
  238.    = {  active_scroll = down_up; beq  §
  239.         upwards = true
  240.         across  = false
  241.    }
  242.    chr  ?  #$4D   · down arrow
  243.    = {  active_scroll = down_up; beq  §
  244.         upwards = false
  245.         across  = false
  246.    }
  247.  
  248.  
  249.    chr  ?  #$4E   · forward arrow
  250.    = {  active_scroll = down_up; beq  §
  251.         upwards = false
  252.         across  = true
  253.    }
  254.    chr  ?  #$4F   · backward arrow
  255.    = {  active_scroll = down_up; beq  §
  256.         upwards = true
  257.         across  = true
  258.    }
  259.  · The qualifier supposedly delivered by the IDCMP doesn't work, so ...
  260.  byte  altkey_flag
  261.                   chr  ?  #$64; = « altkey_flag = down_up »
  262.                   chr  ?  #$65; = « altkey_flag = down_up »
  263.  byte  lshift_flag
  264.                   chr  ?  #$60; = « lshift_flag = down_up »
  265.  byte  rshift_flag
  266.                   chr  ?  #$61
  267.                   = { rshift_flag = down_up
  268.                       tst.b  box_tool
  269.                       != { a1.l  =  rememspr
  270.                            Make the pointer a bar pattern
  271.                       }
  272.                   ->  §
  273.                   }
  274.  byte  ctrl_flag
  275.                   chr  ?  #$63; = « ctrl_flag = down_up »
  276.  
  277.  byte  spbar_flag
  278.  word  areapoints
  279.    chr  ?  #$40
  280.    = { spbar_flag = down_up
  281.        = { active_drag  =  false
  282.         · AreaEnd if enough area points
  283.            adr  =  ^areapoints
  284.            tst.w  (adr); beq  §
  285.            push  =  adr
  286.            Draw a real line to here
  287.            adr   =  pop
  288.            d1.w  ?  17
  289.            > { clr.w  (adr)
  290.                graphics AreaDraw
  291.                graphics AreaEnd
  292.            }
  293.        }
  294.        ->  §
  295.    }
  296.  
  297.    tst.b  down_up;  beq  §
  298.  
  299.    chr  ?  #$46   · del
  300.    = {  Erase the page, and draw the palette
  301.         ->  §
  302.    }
  303.  
  304.    chr  ?  #$21   · S
  305.    = {  --Save picture
  306.         ->  §
  307.    }
  308.  
  309.    chr  ?  #$13   · R
  310.    = {  Restore picture
  311.         ->  §
  312.    }
  313.  
  314.  
  315.  
  316. Select the palette color
  317.       byte  sel_color
  318.       byte  selb_color
  319.       byte  selo_color
  320.  
  321.    d1.b  =  sel_color
  322.    tst.w    d0; = «  sel_color = 0  »
  323.    != { d0   +=  5
  324.         tst.b  curr_tool; = «  d0   +=  8  »
  325.         d0   /=  10
  326.         sel_color  =  d0
  327.    }
  328.    tst.b  rshift_flag
  329.    != { curr_tool  ?  2
  330.         = { tst.b  alttool
  331.             bne  .letedge
  332.         }
  333.         tst.b  curr_tool
  334.         = { tst.b  box_tool
  335.             =  {  sel_color  =  d1
  336.                   selo_color =  chr
  337.                   d1   =  0
  338.                   d1.b =  chr
  339.                   lng  =  d1
  340.                   d1   =  19
  341.                   push =  d1
  342.                   ->  .blck.edge
  343.             }
  344.           .letedge:
  345.             sel_color  =  d1
  346.             selb_color =  chr
  347.             graphics SetBPen
  348.             d0   =  0
  349.             chr  =  selb_color
  350.             d1   =  17
  351.             push =  d1
  352.             ->  .oth.edge
  353.         }
  354.    }
  355.    curr_color  =  chr
  356.    graphics SetAPen
  357.  
  358.    d0    =  18   · color register for pointer
  359.    push  =  d0
  360.  
  361.    d0  =  0
  362.    chr  =  curr_color
  363.  .blck.edge:
  364.    tst.b    chr
  365.    =  { d0.l  = #$033
  366.         ->  .def.edge
  367.    }
  368.  .oth.edge:
  369.    chr  ?  16
  370.    >= { d1  =  canvas; d2.l = d1; d3.l = d1
  371.         chr  ?  48
  372.         >= «  chr -= 48; d2.b = chr  »
  373.         chr  ?  32
  374.         >= «  chr -= 32; d1.b = chr  »
  375.         chr  ?  16
  376.         >= «  chr -= 16; d3.b = chr  »
  377.         ->  .rgb.edge
  378.    }
  379.    adr   =  viewport
  380.    adr   =  4(adr)
  381.    graphics GetRGB4
  382.    d0.l  &= #$0FFF
  383.  .def.edge:
  384.    d1.l  =  d0
  385.    d1.w  >>= 8
  386.    d2.l  =  d0
  387.    d2.w  >>= 4
  388.    d2.w  &=  #$0F
  389.    d3.l  =  d0
  390.    d3.w  &=  #$0F
  391.  
  392.  .rgb.edge:
  393. · does not work for color > 15 if pass viewport address
  394. · does if we pass null (undocumented feature)
  395.    d0   =  0
  396.    adr  =  d0
  397.  
  398.    d0.l  =  pop
  399.    graphics SetRGB4
  400.  
  401.  
  402. --Set up basic colors
  403.    a2   =  ^basic.colors
  404. ·   d0   =  17
  405. ·   d1   =  0; d2  =  0; d3  =  0
  406. ·   adr  =  d1
  407. ·   d1.b =  (a2); d2.b = 1(a2); d3.b = 2(a2)
  408. ·   graphics  SetRGB4
  409.  
  410.    adr  =  viewport
  411.    d0   =  0
  412.    {  d1  =  0;  d2  =  0;  d3  =  0
  413.       d1.b  =  (a2)+
  414.       d2.b  =  (a2)+
  415.       d3.b  =  (a2)+
  416.       push  =  d0
  417.       push  =  adr
  418.       chr  ?  16; >= « adr -= adr »
  419.       graphics  SetRGB4
  420.       adr   =  pop
  421.       d0.l  =  pop
  422.       d0   +=  1
  423. ·      chr   ?  16
  424.       chr   ?  20
  425.       bne   }
  426.  
  427.  
  428. Make a box
  429.       byte  curr_color
  430.    Get mouse coordinates
  431.    d1.w  ?  17
  432.    <= {  Select the palette color
  433.          ->  §
  434.    }
  435.    What color shall we use?
  436.  
  437.    d2.l =  d0
  438.    d3.l =  d1
  439.    d2  += 16; d3 += 15
  440.    d0  += 1        · fine tuning
  441.    d2.w  ?  tot_width;  bcc  §
  442.    d3.w  ?  tot_height;  bcc  §
  443.    tst.b  box_tool
  444.    = {  tst.b  alttool
  445.         != { --Copy the last square
  446.               ->  §
  447.         }
  448.    }
  449.    graphics RectFill
  450.  
  451.  
  452. --Draw the palette
  453.    lng   =  1
  454.    d1    = -6
  455.    d3    =  2
  456.    {  push  =  lng
  457.       movem.l  d1/d3,-(sp)
  458.       graphics  SetAPen
  459.       movem.l  (sp)+,d0/d2
  460.       d0   +=  10
  461.       d1    =   4    · some border at top
  462.       d2   +=  10
  463.       d3    =  16
  464.       movem.l  d0/d2,-(sp)
  465.       graphics  RectFill
  466.       movem.l  (sp)+,d1/d3
  467.       lng   =  pop
  468.       lng  +=  1
  469.       chr   ?  64
  470.       bne   }
  471.  
  472.  
  473. --Drag the thing
  474.  
  475.    chr  =  shifttool
  476.    != { chr  ?  2
  477.         != { tst.b  curr_tool
  478.               = { Make a box
  479.                   ->  §
  480.               }
  481.         }
  482.         Get mouse coordinates
  483.         d1.w  ?  17
  484.         <= {  Select the palette color
  485.               ->  §
  486.         }
  487.         What color shall we use?
  488.         --Do pattern with template
  489.         ->  §
  490.    }
  491.  
  492.    What color shall we use?
  493.  
  494.    Get mouse coordinates
  495.    d1.w  ?  17; >  §
  496.    push  =  d1
  497.    push  =  d0
  498.    tst.b  sptool
  499.    = { tst.b  spbar_flag
  500.    = { curr_tool  ?  1
  501.        = { --Big dot
  502.            ->  §
  503.        }
  504.    }
  505.    }
  506.    Draw ephemeral line
  507.    d0.l  =  pop
  508.    d1.l  =  pop
  509.    adr   =  ^line.2pos
  510.    (adr)+.l = d0
  511.    (adr).l  = d1
  512.    Draw ephemeral line
  513.  
  514.  
  515. --Big dot
  516.    tst.b   alttool
  517.    = { d0.w  ?  tot_width - 3
  518.        < { d1.w  ?  tot_height - 3
  519.            >=  [
  520.        }
  521.            a7  +=  8
  522.            ->  §
  523.            ]
  524.  
  525.        graphics WritePixel
  526.        d0.l  =  (sp)
  527.        d1.l  = 4(sp)
  528.        d0   -=  1
  529.        + « graphics WritePixel »
  530.        d0.l  =  (sp)
  531.        d1.l  = 4(sp)
  532.        d0   +=  1
  533.        graphics WritePixel
  534.        d0.l  =  (sp)
  535.        d1.l  = 4(sp)
  536.        d1   +=  1
  537.        graphics WritePixel
  538.    }
  539.    d0.l  =  pop
  540.    d1.l  =  pop
  541.    d1   -=  1
  542.    graphics WritePixel
  543.  
  544.  
  545. Draw a real line to here
  546.    Draw ephemeral line
  547.    What color shall we use?
  548.    adr  =  ^line.1pos
  549.    d0.l =  (adr)+; d2.l = d0
  550.    d1.l =  (adr);  d3.l = d1
  551.    graphics Move
  552.    Get mouse coordinates
  553.    d1.w  ?  17; bls  §
  554.    movem.l  d0/d1,-(sp)
  555.    --Draw a real something
  556.    movem.l  (sp)+,d0/d1
  557.  
  558.  
  559. --Draw a real something
  560.    tst.b  sptool
  561.    = { Box or line
  562.        ->  §
  563.    }
  564.  
  565.    curr_tool  ?  2
  566.    = { movem.l  d0-d3,-(sp)
  567.        Exchange corners
  568.        d0 += 1; d2 -= 1
  569.        d1 += 1; d3 -= 1
  570.        movem.l  d0-d3,saverect
  571.        movem.l  (sp)+,d0-d3
  572.        Box or line
  573.        -> §
  574.    }
  575.    Exchange corners
  576.    tst.b  curr_tool
  577.    = { graphics  RectFill
  578.        -> §
  579.    }
  580.    d2.l -= d0
  581.    d3.l -= d1
  582.    d2.l  >>=  1
  583.    d3.l  >>=  1
  584.    d0.l +=  d2
  585.    d1.l +=  d3
  586.    tst.b  spbar_flag
  587.    = {  graphics  DrawEllipse
  588.     -> §
  589.    }
  590.    graphics  AreaEllipse
  591.    graphics  AreaEnd
  592.    clr.w  areapoints
  593.    active_drag  =  false
  594.  
  595. Exchange corners
  596.    d0.l  ?  d2
  597.    > « exg  d0,d2 »
  598.    d1.l  ?  d3
  599.    > « exg  d1,d3 »
  600.  
  601. Draw ephemeral line
  602.    adr  =  ^line.1pos
  603.    tst.l  8(adr); bmi  §
  604.    push  =  adr
  605.    d0  =  2
  606.    graphics SetDrMd
  607.    adr  =  pop
  608.    d0.l  =  (adr)+; d2.l = d0
  609.    d1.l  =  (adr)+; d3.l = d1
  610.    push  =  adr
  611.    graphics Move
  612.    adr   =  pop
  613.    d0.l  =  (adr)+
  614.    d1.l  =  (adr)
  615.    Box or line
  616.  
  617.  
  618. Box or line
  619.    tst.b sptool
  620.    != {  push  =  d1
  621.          push  =  d0
  622.          d1.l  =  d3
  623.          graphics  Draw
  624.          d0.l  =  (sp)
  625.          d1.l  = 4(sp)
  626.          graphics  Draw
  627.          d0.l  =  d2
  628.          d1.l  = 4(sp)
  629.          graphics  Draw
  630.          a7   +=  8
  631.          d0.l  =  d2
  632.          d1.l  =  d3
  633.    }
  634.    graphics Draw
  635.  
  636.  
  637.  
  638. What color shall we use?
  639.    movem.l  d0/d1,-(sp)
  640.    d0  =  0
  641.    tst.b  altkey_flag
  642.    = {   chr  =  sel_color
  643.          bne   ¶
  644.          chr  =  curr_color
  645.          chr +=  1
  646.          chr  ?  64; = « chr  =  1  »
  647.          curr_color  =  chr
  648.    }
  649.    push      =  d0
  650.    graphics SetAPen
  651.    d1.l      =  pop
  652.    d0        =  0
  653.    chr       =  selo_color
  654.    = « chr    =  selb_color »
  655.    adr       =  srastport
  656. · outline pen works only in jam2
  657.    bset     #3,32(adr)
  658. ·   tst.b  rshift_flag; != « d1.b = chr »
  659.    27(adr).b = chr     · outline pen
  660.  
  661.    chr       =  selb_color
  662.    graphics SetBPen
  663.    d0        =  0
  664.    tst.b  ctrl_flag; != « bset  #2,d0  »
  665.    tst.b  lshift_flag; != « bset  #1,d0  »
  666.    tst.b  rshift_flag; != « bset  #0,d0  »
  667.    graphics SetDrMd
  668.    movem.l  (sp)+,d0/d1
  669.  
  670.  
  671. Get mouse coordinates
  672.    adr    =  the_screen
  673.    d0     =  0
  674.    d0.w   =  18(adr)
  675.    d0.w  +=  h_pos
  676.    d1     =  0
  677.    d1.w   =  16(adr)
  678.    d1.w  +=  v_pos
  679.  
  680.  
  681.  
  682. --Change tools
  683.       byte  box_tool
  684.       byte  alttool
  685.       byte  shifttool
  686.       byte  sptool
  687.       define lastboxtool  2
  688.  
  689.    alttool    =  altkey_flag
  690.    shifttool  =  rshift_flag
  691.    sptool     =  spbar_flag
  692.  
  693.    tst.b  lshift_flag; != « shifttool  =  2 »
  694.    adr  =  srastport
  695.    34(adr).w  = -1
  696.  
  697.    chr  =  curr_tool
  698.    = { chr  =  box_tool  · here it's one of the box tools
  699.        chr  ?  lastboxtool
  700.        = { curr_tool = 1
  701.            Make the pointer a brush
  702.            ->  §
  703.        }
  704.       chr  += 1
  705.       box_tool  =  chr
  706.       a1   =  ^hbar.sprite
  707.       chr  ?  1; != « a1  =  ^vbar.sprite  »
  708. ·      adr  =  srastport
  709.       $1D(adr).b  = 2
  710.       tst.b  alttool; != « a1.l += 80 »
  711.  
  712.       a2  =  ^square.sprite
  713.       d0.l  =  a1
  714.       d0.l -=  a2
  715.       d0   -=  8
  716.       Set the fill pattern
  717. ·      a1  -=  8
  718. ·      8(adr).l = a1
  719. ·      a1  +=  8
  720.       Make the pointer a bar pattern
  721.       ->  §
  722.    }
  723.    chr  ?  2   · last of brush tools?
  724.    != { chr += 1
  725.         curr_tool  = chr
  726.      · shape select for 2nd brush-type tool
  727.         · in case doing area fill
  728. ·       adr        =  srastport
  729.         $1D(adr).b = -2
  730.         d0.l   = # funny.fill - square.sprite
  731. ·        34(adr).w  = -1
  732.         a1         =  ^line.sprite
  733.         tst.b  alttool
  734.         != { 34(adr).w  =  %1100110011001100
  735.              a1         =  ^line2.sprite
  736.              tst.b  rshift_flag
  737.              != «  a1  =  ^bline2.sprite  »
  738.              d0.l   =  # funnydot.fill - square.sprite
  739.         }
  740.     Set the fill pattern   
  741.         Make the pointer a pattern
  742.         ->  §
  743.    }
  744.  · done all brush tools, now start boxes
  745.    clr.b   curr_tool
  746.    clr.b   box_tool
  747. ·   adr  =  srastport
  748.    8(adr).l  =  0
  749.    tst.b  alttool
  750.    != { Get mouse coordinates
  751.         d0  += 1
  752.         adr  =  ^last.square
  753.         (adr)+.l = d0
  754.         (adr).l  = d1
  755.         a1  =  ^square.2sprite
  756.         Make the pointer a pattern
  757.         ->  §
  758.    }
  759.    Make the pointer square
  760.  
  761.  
  762.  
  763.  
  764.  
  765. Make the pointer a brush
  766.    adr =  srastport
  767.    8(adr).l  =  0
  768.    $1D(adr).b = -2
  769.    d0.l = # funny.2fill - square.sprite
  770.    a1.l  =  ^brush.sprite
  771.    tst.b  alttool
  772.    != { a1.l  =  ^brush.2sprite
  773.         d0.l = # funny.3fill - square.sprite
  774.    }
  775.    tst.b  sptool
  776.    = « Set the fill pattern »
  777.    Make the pointer a pattern
  778.  
  779. Set the fill pattern
  780.    a2.l  =  tempb
  781.    a2.l  +=  d0
  782.    8(adr).l  =  a2
  783.  
  784. Make the pointer square
  785.    a1.l  =  ^square.sprite
  786.    Make the pointer a pattern
  787.  
  788.  
  789. Make the pointer a pattern
  790.       long  rememspr
  791.    rememspr = a1
  792.  
  793.    chr  =  shifttool
  794.    != { tst.b curr_tool; bne ¶
  795.         a1 += 4
  796.         adr   =  ^blt.pat
  797.         chr  ?  2
  798.         = « adr  =  ^blt.2pat »
  799.         tst.b  sptool
  800.         != « adr  =  ^blt.3pat »
  801.         a2.l  =  temp.sprite
  802.         a2 +=  4
  803.         d3  =  15
  804.         { d1.w  = (adr)+
  805.           d2.w  = (a1)+
  806.           tst.b box_tool
  807.           = « d2 = 0 »
  808.           chr ? 1; = « d1 = -1 »
  809.           d2.w &= d1
  810.           (a2)+.w = d2
  811.           d2.w  = (a1)+
  812.           tst.b box_tool
  813.           = « d2 = -1 »
  814.           chr ? 1; = « d1 = -1 »
  815.           d2.w &= d1
  816.           (a2)+.w = d2
  817.           dbra  d3,}
  818.         a1.l  =  temp.sprite
  819.     ->  [
  820.    }
  821.  
  822.    adr   =  ^square.sprite
  823.    a1.l -=  adr
  824.    adr   =  tempb
  825.    a1.l +=  adr
  826.     ]
  827.  
  828.    adr   =  the_window
  829.    d0    =  16    · height
  830.    d1    =  16    · width
  831.    d2    =  0     · x offset
  832.    d3    =  0     · y offset
  833.    intuit SetPointer
  834.  
  835. Make the pointer a bar pattern
  836.    tst.b  rshift_flag; != «  Use bars with background  »
  837.    tst.b  rshift_flag;  = «  Use plain bars  »
  838.    Make the pointer a pattern
  839.  
  840.  
  841. Use bars with background
  842.    a1.l  ?  #hbar.sprite;  = « a1  =  ^bhbar.sprite  »
  843.    a1.l  ?  #ahbar.sprite; = « a1  =  ^bahbar.sprite  »
  844.    a1.l  ?  #vbar.sprite;  = « a1  =  ^bvbar.sprite  »
  845.    a1.l  ?  #avbar.sprite; = « a1  =  ^bavbar.sprite  »
  846.    a1.l  ?  #line2.sprite; = « a1  =  ^bline2.sprite  »
  847.  
  848. Use plain bars
  849.    a1.l  ?  #bhbar.sprite;  = « a1  =  ^hbar.sprite  »
  850.    a1.l  ?  #bahbar.sprite; = « a1  =  ^ahbar.sprite  »
  851.    a1.l  ?  #bvbar.sprite;  = « a1  =  ^vbar.sprite  »
  852.    a1.l  ?  #bavbar.sprite; = « a1  =  ^avbar.sprite  »
  853.    a1.l  ?  #bline2.sprite; = « a1  =  ^line2.sprite  »
  854.  
  855.  
  856. --Scroll the screen
  857.       define vscr_incr  4
  858.       define hscr_incr  4
  859.  
  860.    graph  WaitTOF
  861.  
  862.    tst.b    across
  863.    != « --Scroll across; ->  §  »
  864.  
  865.    v_pos += vscr_incr
  866.    tst.b  upwards; != « v_pos -= 2 * vscr_incr »
  867.  
  868.    wrd  =  v_pos
  869.    -  «  v_pos += vscr_incr; ->  §  »
  870.    wrd  ?  #tot_height  - winheight
  871.    > {  v_pos = #tot_height - winheight
  872.         wrd   = v_pos
  873.    }
  874.    Vertical scroll
  875.  
  876.  
  877. --Scroll across
  878.  
  879.    h_pos += hscr_incr
  880.    tst.b  upwards; != « h_pos -= 2 * hscr_incr »
  881.  
  882.    wrd  =  h_pos
  883.    -  «  h_pos += hscr_incr; ->  §  »
  884.    wrd  ?  #tot_width  - winwidth
  885.    > { h_pos  =  #tot_width - winwidth
  886.        wrd    =  h_pos
  887.    }
  888.    Horizontal scroll
  889.  
  890.  
  891. --Copy the last square
  892.    movem.l  d2-d7,-(sp)
  893.  
  894.    d2.l  =  d0    · dest x
  895.    d3.l  =  d1    · dest y
  896.  
  897.    adr   =  ^last.square
  898.    d0.l  =  (adr)+   · source x
  899.    d1.l  =  (adr)    · source y
  900.  
  901.    adr   =  srastport
  902.    adr   =  4(adr)   · should be bitmap of srastport
  903.    a1.l  =  adr      · source and dest. bitmaps are same
  904.    d4.l  =  15       · size x
  905.    d5.l  =  15       · size y
  906.    Choose minterm
  907.    d7.l  =  #$FF     · mask
  908.    a2.l  =  tempa
  909.    graph BltBitMap
  910.  
  911.    movem.l  (sp)+,d2-d7
  912.  
  913. Choose minterm
  914.    d6   =  0
  915.    d6.b = #$E0          · PAT or DEST
  916.    tst.b  altkey_flag; != « d6.b = #$30 »  · !PAT
  917.    tst.b  rshift_flag
  918.    != { d6.b  =  #$C0   · PAT
  919.         tst.b  altkey_flag; != « d6.b = #$60 »  · cookie cut
  920.         ->  §
  921.    }
  922.    tst.b  ctrl_flag; != « d6.b  =  #$80 »    · sieve
  923.    tst.b  lshift_flag; beq  §
  924.    d6.b = #$D0          · PAT or !DEST
  925.    tst.b  altkey_flag; != « d6.b = #$70 »  · !PAT or !DEST
  926.  
  927.  
  928. --Do pattern with template
  929.    adr   =  ^blt.pat
  930.    shifttool  ?  2
  931.    = « adr  =  ^blt.2pat »
  932.    tst.b  sptool
  933.    != « adr  =  ^blt.3pat »
  934.  
  935.    a1  =  ^square.sprite
  936.    adr -=  a1
  937.    a1.l  =  tempb
  938.    adr  +=  a1
  939.  
  940.    tst.b  curr_tool
  941.    != { d0 -= 8; bmi  §
  942.         d1 -= 8; bmi  §
  943.    }
  944.    d1.w  ?  17; bcs  §
  945.  
  946.    d2.l  =  d0; d2 += 15
  947.    d2.w  ?  tot_width; bcc  §
  948.  
  949.    d3.l  =  d1; d3 += 15
  950.    d3.w  ?  tot_height; bcc  §
  951.  
  952.    d4    =  2
  953.    graphics BltPattern
  954.  
  955.  
  956. Horizontal scroll
  957.    adr   =  rasinfo
  958.    8(adr).w = d0    · change Rxoffset (Ryoffset is 10(adr).w)
  959.    adr  = viewport
  960.    graphics ScrollVPort
  961.  
  962.  
  963. Vertical scroll
  964.    adr   =  rasinfo
  965.    10(adr).w = d0    · change Rxoffset (Ryoffset is 10(adr).w)
  966.    adr  = viewport
  967.    graphics ScrollVPort
  968.  
  969.  
  970.  
  971.  
  972. Display string
  973. ·  message to console
  974.   define    l_length  D3.L
  975.  
  976.    tst.l  wb_message; bne §
  977.    arg`a      =  chandle
  978.    l_length   =  0
  979.    l_length.b = (adr)+
  980.    arg`b      =  adr
  981.    calldos  Write
  982.  
  983.  
  984.  
  985. Show string
  986.    push     =  adr
  987.    d0       =  50
  988.    d1       =  50
  989.    graphics Move
  990.    d0       =  2
  991.    graphics SetDrMd
  992.    adr      =  pop
  993.    d0       =  0
  994.    d0.b     =  (adr)+
  995.    d0      -=  1
  996.    graphics Text
  997.    d0       =  0
  998.    graphics SetDrMd
  999.  
  1000.  
  1001. Erase the page, and draw the palette
  1002.  
  1003.    a1.l  =  srastport
  1004.    push  =  8(a1)    ·   save area pattern
  1005.    d0    =  0
  1006.    8(a1).l =  d0
  1007.    d0.b  =  $19(a1)  ·   save fgpen
  1008.    push  =  d0
  1009.    d0.b  =  $1C(a1)  ·   save draw mode
  1010.    push  =  d0
  1011.    d0    =  0
  1012.    graphics SetDrMd
  1013.    d0    =  0
  1014.    graphics SetAPen
  1015.    push.w  =  32(a1)
  1016.    bclr  #3,32(a1)   · no area outline
  1017.    d0    =  0
  1018.    d1    =  0
  1019.    d2.l  =  tot_width - 1
  1020.    d3.l  =  tot_height - 1
  1021.    push  =  a1
  1022.    graphics RectFill
  1023.    --Draw the palette
  1024.    a1.l  =  pop
  1025.    32(a1).w = pop
  1026.    d0.l  =  pop      · old mode
  1027.    d2.l  =  pop      · old fg pen
  1028.    8(a1).l = pop     · old area pattern
  1029.    graphics SetDrMd
  1030.    d0.l  =  d2
  1031.    graphics SetAPen
  1032.  
  1033. --Save picture
  1034.    movem.l  saverect,d0-d3
  1035.    d2.l    -=  d0; beq §
  1036.    d3.l    -=  d1; beq §
  1037.  
  1038.    Make a bit map
  1039.    Supply memory for planes
  1040.    tst.l  d2
  1041.    != { --Blit picture to save area
  1042.         --Open a file for picture
  1043.         != « --Write picture in file and close »
  1044.    }
  1045.    Return memory for planes
  1046.  
  1047. Restore picture
  1048.    --Open the old picture file
  1049.    beq   §
  1050.    --Find out where picture came from
  1051.    --Put it where mouse is
  1052.    Make a bit map
  1053.    Supply memory for planes
  1054.    tst.l  d2
  1055.    != { --Read file to raster
  1056.         --Blit picture back to canvas
  1057.    }
  1058.    arg`a  =  pichandle
  1059.    calldos Close
  1060.    Return memory for planes
  1061.  
  1062.  
  1063. --Put it where mouse is
  1064.    Get mouse coordinates
  1065.    d1.w  ?  17; bls  §
  1066.    movem.l d4-d5,-(sp)
  1067.    d4.l  =  d0
  1068.    d5.l  =  d1
  1069.    movem.l  saverect,d0-d3
  1070.    d4.l -=  d0
  1071.    d0.l +=  d4
  1072.    d2.l +=  d4
  1073.    d5.l -=  d1
  1074.    d1.l +=  d5
  1075.    d3.l +=  d5
  1076.    movem.l (sp)+,d4-d5
  1077.    d2.w  ?  tot_width; bcc §
  1078.    d3.w  ?  tot_height; bcc §
  1079.    movem.l  d0-d3,saverect
  1080.  
  1081.  
  1082. Make a bit map
  1083.    movem.l  saverect,d0-d3
  1084.    d2.l    -=  d0
  1085.    d3.l    -=  d1
  1086.    d1.l     =  d2
  1087.    d2.l     =  d3
  1088.    adr      =  ^save.bit.map
  1089.    d0       =  6        · depth
  1090.    graphics InitBitMap
  1091.  
  1092. Supply memory for planes
  1093.    movem.l  saverect,d0-d3
  1094.    d2.l    -=  d0
  1095.    d3.l    -=  d1
  1096.    d0.l     =  d2
  1097.    d1.l     =  d3
  1098.    adr      =  ^save.planes
  1099.    d3  =  5
  1100.    {  movem.l  d0/d1/a0,-(sp)
  1101.       graph  AllocRaster
  1102.       d2.l  =  rtn
  1103.       movem.l  (sp)+,d0/d1/a0
  1104.       (adr)+.l =   d2
  1105.       tst.l d2; beq ¶
  1106.       dbra  d3,}
  1107.  
  1108.  
  1109. --Blit picture to save area
  1110.    a2.l -=  a2
  1111.    Blit to or from canvas
  1112.  
  1113. --Blit picture back to canvas
  1114.    a2     =  1
  1115.    Blit to or from canvas
  1116.  
  1117.  
  1118. Blit to or from canvas
  1119.    movem.l  d2-d7,-(sp)
  1120.  
  1121.    adr   =  srastport
  1122.    adr   =  4(adr)   · bitmap of srastport
  1123.    a1.l  =  ^save.bit.map
  1124.  
  1125.    movem.l  saverect,d0-d3
  1126.    d4.l = d2; d4.l -= d0   · size x
  1127.    d5.l = d3; d5.l -= d1   · size y
  1128.    d2  =  0    · dest x
  1129.    d3  =  0    · dest y
  1130.  
  1131.    d6.l = #$C0
  1132.  
  1133.    d7   =  a2
  1134.    != { exg  d0,d2
  1135.         exg d1,d3
  1136.         exg a0,a1
  1137.         Choose minterm
  1138.    }
  1139.  
  1140.    d7.l  =  #$FF     · mask
  1141.    a2.l  =  tempa
  1142.    graph BltBitMap
  1143.  
  1144.    movem.l  (sp)+,d2-d7
  1145.  
  1146.  
  1147.  
  1148.  
  1149. --Open a file for picture
  1150.       long pichandle
  1151.    arg`a  =  picturename
  1152.    arg`b  =  # 1006
  1153.    calldos  Open
  1154.    pichandle  =  rtn
  1155.  
  1156. --Open the old picture file
  1157.       long pichandle
  1158.    arg`a  =  picturename
  1159.    arg`b  =  # 1005
  1160.    calldos  Open
  1161.    pichandle  =  rtn
  1162.  
  1163. Name of picture file
  1164. pfname
  1165.    dc.b 'ram:pic',0
  1166.    cnop  0,2
  1167.  
  1168. --Find out where picture came from
  1169.    arg`a  =  pichandle; beq §
  1170.    arg`b  = # saverect
  1171.    d3     =  16
  1172.    calldos  Read
  1173.  
  1174. --Write picture in file and close
  1175. ( keep where it came from )
  1176.    arg`a  =  pichandle; beq §
  1177.    arg`b  = # saverect
  1178.    d3     =  16
  1179.    calldos  Write
  1180.  
  1181.    How big is each plane?
  1182.  
  1183.    a2     =  ^save.planes
  1184.    arg`a  =  pichandle
  1185.    d0  =  5
  1186.    {  arg`b  =  (a2)+
  1187.       beq   ¶
  1188.       movem.l  d0/arg`a,-(sp)
  1189.       calldos  Write
  1190.       movem.l  (sp)+,d0/arg`a
  1191.       dbra  d0,}
  1192.  
  1193.    calldos  Close
  1194.  
  1195. --Read file to raster
  1196.    How big is each plane?
  1197.  
  1198.    a2     =  ^save.planes
  1199.    arg`a  =  pichandle
  1200.    d0  =  5
  1201.    {  arg`b  =  (a2)+
  1202.       beq   ¶
  1203.       movem.l  d0/arg`a,-(sp)
  1204.       calldos  Read
  1205.       movem.l  (sp)+,d0/arg`a
  1206.       dbra  d0,}
  1207.  
  1208.  
  1209.  
  1210. How big is each plane?
  1211.    movem.l  saverect,d0-d3
  1212.    d2.l  -=  d0
  1213.    d2    += 7
  1214.    d2.l >>=  3    · bytes per row
  1215.    d2    +=  1    · round to word
  1216.    bclr  #0,d2
  1217.    d3.l  -=  d1   · rows
  1218.    d3    *=  d2   · bytes per plane
  1219.  
  1220.  
  1221. Return memory for planes
  1222.    movem.l  saverect,d0-d3
  1223.    d2.l    -=  d0
  1224.    d3.l    -=  d1
  1225.    d0.l     =  d2
  1226.    d1.l     =  d3
  1227.    adr      =  ^save.planes
  1228.    d3  =  5
  1229.    {  d2.l  =  (adr)+
  1230.       beq   ¶
  1231.       movem.l  d0/d1/a0,-(sp)
  1232.       adr   =  d2
  1233.       graph  FreeRaster
  1234.       movem.l  (sp)+,d0/d1/a0
  1235.       dbra  d3,}
  1236.  
  1237.  
  1238.  
  1239.  
  1240. --Get file name from input line
  1241.    long     picturename
  1242.    define   command_tail   A0.L
  1243.    define   tail_length    D0
  1244.    define   input_name     A1.L
  1245.    define   fn_char        D1.B
  1246.  
  1247.  
  1248.    tst.l  wb_message
  1249.    != { --Get file name from message
  1250.         ->  §
  1251.    }
  1252.  
  1253.    input_name     =  ^infname
  1254.    push  =  input_name
  1255.  
  1256.    ->       next_fname_char
  1257.    {  fn_char  =  (command_tail)+
  1258.       fn_char  ?  ' ' + 1;   blt   ¶
  1259.       (input_name)+.b  =  fn_char
  1260.       tail_length -= 1
  1261.   next_fname_char:
  1262.       tst.l    tail_length
  1263.       bne   }
  1264.    clr.b    (input_name)
  1265.  
  1266.    input_name  =  pop
  1267.    tst.b  (input_name); beq  §
  1268.    picturename = input_name
  1269.  
  1270.  
  1271. --Get file name from message
  1272.  
  1273.    a3.l -= a3
  1274.    a2.l  =  wb_message
  1275.    28(a2).l  ?  1; bls  §
  1276.  
  1277.    d0.l  =  36(a2)
  1278.    != {  adr  =  d0
  1279.          arg`a = 8(adr)
  1280.          != { a3.l  = 12(adr)
  1281.               calldos CurrentDir
  1282.          }
  1283.    }
  1284.    lng  = a3; beq  §
  1285.    picturename = a3
  1286.  
  1287.  
  1288. --Load requested picture
  1289.  
  1290.    adr  =  ^ picturename
  1291.    tst.l  (adr)
  1292.    = { (adr).l  =  # pfname
  1293.        ->  §
  1294.    }
  1295.    Restore picture
  1296.  
  1297.  
  1298.  
  1299. --Initialize standard input and output
  1300.    long  chandle
  1301.    long  dosbase
  1302.  
  1303.    a1       =  ^libname
  1304.    d0       =  0
  1305.    callex   OpenLibrary
  1306.    dosbase  =  rtn
  1307.    tst.l  wb_message; bne §
  1308.    calldos  Output
  1309.    chandle  =  rtn
  1310.  
  1311.  
  1312. --Initialize the screen
  1313.  
  1314.    long  intuitionbase
  1315.    long  graphicsbase
  1316.  
  1317.    a1       =  ^ilibname
  1318.    d0       =  0
  1319.    callex   OpenLibrary
  1320.    intuitionbase = rtn
  1321.  
  1322.    a1       =  ^glibname
  1323.    d0       =  0
  1324.    callex   OpenLibrary
  1325.    graphicsbase = rtn
  1326.  
  1327.  long    tempa
  1328.    d0.l     =  128
  1329.    d1       =   2       · chip memory
  1330.    callex   AllocMem
  1331.    tempa    =  rtn
  1332.  
  1333.  long    tempb
  1334.    d0.l     =  # endofsprites - square.sprite
  1335.    push     =  d0
  1336.    d0.l    +=  72
  1337.    d1.l     =  #$10002
  1338.    callex   AllocMem
  1339.    tempb    =  rtn
  1340.    a1.l     =  rtn
  1341.    d0.l     =  pop
  1342.    a0       =  ^square.sprite
  1343.    d0      -=  1
  1344.    {   (a1)+.b  =  (a0)+
  1345.        dbra   d0,}
  1346.    temp.sprite.l  =  a1
  1347.  
  1348.    adr      =  ^bit.map
  1349.    d0       =  6        · depth
  1350.    d1.l     =  tot_width
  1351.    d5.l  =  d1
  1352.    d2.l     =  tot_height
  1353.    d6.l  =  d2
  1354.    graphics InitBitMap
  1355.  
  1356.    d0.l  =  d5
  1357.    d1.l  =  d6
  1358.    graphics AllocRaster
  1359.    bm.1plane.l = d0
  1360.    d0.l  =  d5
  1361.    d1.l  =  d6
  1362.    graphics AllocRaster
  1363.    bm.2plane.l = d0
  1364.    d0.l  =  d5
  1365.    d1.l  =  d6
  1366.    graphics AllocRaster
  1367.    bm.3plane.l = d0
  1368.    d0.l  =  d5
  1369.    d1.l  =  d6
  1370.    graphics AllocRaster
  1371.    bm.4plane.l = d0
  1372.    d0.l  =  d5
  1373.    d1.l  =  d6
  1374.    graphics AllocRaster
  1375.    bm.5plane.l = d0
  1376.    d0.l  =  d5
  1377.    d1.l  =  d6
  1378.    graphics AllocRaster
  1379.    bm.6plane.l = d0
  1380.    d0.l  =  d5
  1381.    d1.l  =  d6
  1382.    graphics AllocRaster
  1383.    area.raster.l = d0
  1384.  
  1385.  long  the_screen
  1386.    a0       =  ^new.screen
  1387.    intuit   OpenScreen
  1388.    the_screen  =  rtn
  1389.    win.sptr.l  =  rtn
  1390.  long  viewport
  1391.    adr      =  rtn
  1392.    adr      =  ^$2C(adr)
  1393.    viewport =  adr
  1394.  long  rasinfo
  1395.    adr   =  ^6*4+6*2(adr)
  1396.    rasinfo = (adr)
  1397.  long  srastport
  1398.    adr      =  ^4(adr)
  1399.    srastport = adr
  1400.  
  1401. · ShowTitle(FALSE) around here ??
  1402.  
  1403.  long  the_window
  1404.    adr      =  ^new.window
  1405.    intuit   OpenWindow
  1406.    the_window  =  rtn
  1407.  
  1408.  long  rastport
  1409.    adr      =  rtn
  1410.    adr      =  ^$32(adr)
  1411.    rastport =  (adr)
  1412.  long  messageport
  1413.  long  signalid
  1414.    adr         =  rtn
  1415.    adr         =  $56(adr)
  1416.    messageport =  adr
  1417.    d1       =  0
  1418.    d1.b     =  $0F(adr)
  1419.    lng      =  1
  1420.    lng    <<=  d1
  1421.    signalid =  lng
  1422.  
  1423.  long  currfont
  1424.    adr      =  ^screenfont
  1425.    graphics OpenFont
  1426.    currfont =  rtn
  1427.    adr      =  rtn
  1428.    graphics SetFont
  1429.  
  1430.    d0       =  1
  1431.    graphics SetAPen
  1432.  
  1433.  
  1434.    a1.l  =  srastport
  1435.    adr   =  ^tmpras
  1436.    $0C(a1).l = adr
  1437.    a1.l  =  area.raster
  1438.    d0.l  =  tot_width * tot_height
  1439.    graph    InitTmpRas
  1440.  
  1441.    a1.l  =  srastport
  1442.    adr   =  ^areainfo
  1443.    $10(a1).l = adr
  1444.    a1    =  ^areabuffer
  1445.    d0.l  =  #area.size
  1446.    graph    InitArea
  1447.  
  1448.  
  1449. --Close the screen
  1450.  
  1451.    adr      =  the_window
  1452.    intuit   CloseWindow
  1453.  
  1454.    adr      =  the_screen
  1455.    intuit   CloseScreen
  1456.  
  1457.    adr      =  bm.1plane
  1458.    d0.l     =  tot_width
  1459.    d1.l     =  tot_height
  1460.    graphics FreeRaster
  1461.    adr      =  bm.2plane
  1462.    d0.l     =  tot_width
  1463.    d1.l     =  tot_height
  1464.    graphics FreeRaster
  1465.    adr      =  bm.3plane
  1466.    d0.l     =  tot_width
  1467.    d1.l     =  tot_height
  1468.    graphics FreeRaster
  1469.    adr      =  bm.4plane
  1470.    d0.l     =  tot_width
  1471.    d1.l     =  tot_height
  1472.    graphics FreeRaster
  1473.    adr      =  bm.5plane
  1474.    d0.l     =  tot_width
  1475.    d1.l     =  tot_height
  1476.    graphics FreeRaster
  1477.    adr      =  bm.6plane
  1478.    d0.l     =  tot_width
  1479.    d1.l     =  tot_height
  1480.    graphics FreeRaster
  1481.    adr      =  area.raster
  1482.    d0.l     =  tot_width
  1483.    d1.l     =  tot_height
  1484.    graphics FreeRaster
  1485.  
  1486.    a1.l     =  tempb
  1487.    d0.l     =  # endofsprites - square.sprite
  1488.    d0.l    +=  72 
  1489.    callex   FreeMem
  1490.  
  1491.    a1.l     =  tempa
  1492.    d0.l     =  128
  1493.    callex   FreeMem
  1494.  
  1495.  
  1496.  
  1497. Data sections
  1498.  
  1499.    section  three,bss
  1500.  
  1501. temp.sprite ds.l  1
  1502. saverect    ds.l  4
  1503.  
  1504. bit.map     ds.w  1  · bytes per row
  1505.             ds.w  1  · rows
  1506.             ds.b  1  · flags
  1507.             ds.b  1  · depth
  1508.             ds.w  1  · pad
  1509. bm.1plane   ds.l  1  · planes
  1510. bm.2plane   ds.l  1
  1511. bm.3plane   ds.l  1
  1512. bm.4plane   ds.l  1
  1513. bm.5plane   ds.l  1
  1514. bm.6plane   ds.l  1
  1515.             ds.l  2  · req. to make room for 8
  1516.  
  1517. save.bit.map
  1518.             ds.w  1  · bytes per row
  1519.             ds.w  1  · rows
  1520.             ds.b  1  · flags
  1521.             ds.b  1  · depth
  1522.             ds.w  1  · pad
  1523. save.planes
  1524.             ds.l  8  · planes
  1525.  
  1526.  
  1527. area.raster ds.l  1
  1528.  
  1529. tmpras      ds.l  2
  1530. areainfo    ds.l  4
  1531.             ds.w  4
  1532.  
  1533. areabuffer  ds.b  5*area.size
  1534.  
  1535. infname     ds.b  30
  1536.  
  1537.  
  1538.  
  1539.    section two,data
  1540.  
  1541. libname  dc.b  'dos.library',0
  1542.  
  1543.          bstr  howtoquit,<TYPE ESCAPE TO EXIT>
  1544.  
  1545. signature    dc.b  ' Paint    © Greg Lee, July, 1986 ',0
  1546.             cnop     0,2
  1547.  
  1548. · ========================================================================
  1549. · === NewScreen ==========================================================
  1550. · ========================================================================
  1551. · STRUCTURE NewScreen,0
  1552. ·
  1553. ·    WORD ns_LeftEdge      ; initial Screen dimensions
  1554. ·    WORD ns_TopEdge      ; initial Screen dimensions
  1555. ·    WORD ns_Width      ; initial Screen dimensions
  1556. ·    WORD ns_Height      ; initial Screen dimensions
  1557. ·    WORD ns_Depth      ; initial Screen dimensions
  1558. ·
  1559. ·    BYTE ns_DetailPen      ; default rendering pens (for Windows too)
  1560. ·    BYTE ns_BlockPen      ; default rendering pens (for Windows too)
  1561. ·
  1562. ·    WORD ns_ViewModes      ; display "modes" for this Screen
  1563. ·
  1564. ·    WORD ns_Type      ; Intuition Screen Type specifier
  1565. ·
  1566. ·    APTR ns_Font      ; default font for Screen and Windows
  1567. ·
  1568. ·    APTR ns_DefaultTitle   ; Title when Window doesn't care
  1569. ·
  1570. ·    APTR ns_Gadgets      ; Your own initial Screen Gadgets
  1571. ·
  1572. ·    ; if you are opening a CUSTOMSCREEN and already have a BitMap
  1573. ·    ; that you want used for your Screen, you set the flags CUSTOMBITMAP in
  1574. ·    ; the Types variable and you set this variable to point to your BitMap
  1575. ·    ; structure.  The structure will be copied into your Screen structure,
  1576. ·    ; after which you may discard your own BitMap if you want
  1577. ·    APTR ns_CustomBitMap;
  1578. ·
  1579. · LABEL    ns_SIZEOF
  1580. ·
  1581.  
  1582. new.screen
  1583.    dc.w     0,0,winwidth,winheight
  1584.    dc.w     6             ·    depth
  1585.    dc.b     0,3
  1586.    dc.w     $4800         ·    modes = sprites & ham
  1587.    dc.w     $0F+$40       ·    type = custon & bitmap
  1588.    dc.l     screenfont    ·    font
  1589.    dc.l     signature     ·    title
  1590.    dc.l     0             ·    no gadgets
  1591.    dc.l     bit.map       ·    bitmap
  1592.  
  1593.  
  1594. new.window
  1595.    dc.w     0,0,winwidth,winheight
  1596.    dc.b     0,3
  1597.    dc.l     $00000400+$08    ·  rawkey & mouse buttons
  1598. · flag req. simple refresh ($40), borderless,
  1599. · activate ($1000), rmbtrap ($10000), nocarerefresh ($20000)
  1600.    dc.l     $40+$0800+$1000+$10000+$20000
  1601.    dc.l      0           ·  first gadget
  1602.    dc.l      0           ·  check mark
  1603.    dc.l      signature   ·  title
  1604. win.sptr
  1605.    dc.l      0           ·  screen
  1606.    dc.l      0           ·  bitmap
  1607.    dc.w     0,0     ·    minimum width and height
  1608.    dc.w     0,0     ·    maximum width and height
  1609.    dc.w     $0F     ·       type = customscreen  (not bitmap, I guess)
  1610.  
  1611.  
  1612.  
  1613. screenfont
  1614.    dc.l     dfname
  1615.    dc.w     8
  1616.    dc.b     0
  1617.    dc.b     %01
  1618. dfname   dc.b  'topaz.font',0
  1619.  
  1620.  
  1621. ilibname       dc.b  'intuition.library',0
  1622. glibname       dc.b  'graphics.library',0
  1623.  
  1624. basic.colors
  1625.    dc.b   canvas,canvas,canvas
  1626.    dc.b   3,12,3      · green
  1627.    dc.b   13,4,2      · red
  1628.    dc.b   0,0,15      · blue
  1629.    dc.b   11,11,11    · white
  1630.    dc.b   12,12,0     · yellow
  1631.    dc.b   0,8,2       · olive
  1632.    dc.b   10,0,9      · wine
  1633.    dc.b   6,2,0       · rust
  1634.    dc.b   0,6,6       · sea
  1635.    dc.b   9,15,1      · apple
  1636.    dc.b   14,11,0     · orange
  1637.    dc.b   12,0,4      · fire
  1638.    dc.b   9,2,15      · grape
  1639.    dc.b   12,7,7      · salmon
  1640.    dc.b   0,15,8      · sky
  1641. · for the pointer
  1642.    dc.b   0,0,0   · cr 16 is not shown
  1643.    dc.b   canvas,canvas,canvas   · cr 17: background
  1644.    dc.b   0,3,3   · cr 18: foreground
  1645.    dc.b   0,3,3   · cr 19: outline
  1646.  
  1647.  
  1648.    cnop  0,2
  1649.  
  1650. line.1pos   dc.l  0,0
  1651. line.2pos   dc.l  0,0
  1652.  
  1653. last.square dc.l  0,17
  1654.  
  1655. square.sprite
  1656.    dc.w  0,0
  1657.    dc.w  %0000000000000000,%1111111111111111
  1658.    dc.w  %0000000000000000,%1111111111111111
  1659.    dc.w  %0000000000000000,%1100000000000011
  1660.    dc.w  %0000000000000000,%1100000000000011
  1661.    dc.w  %0000000000000000,%1100000000000011
  1662.    dc.w  %0000000000000000,%1100000000000011
  1663.    dc.w  %0000000000000000,%1100000000000011
  1664.    dc.w  %0000000000000000,%1100000000000011
  1665.    dc.w  %0000000000000000,%1100000000000011
  1666.    dc.w  %0000000000000000,%1100000000000011
  1667.    dc.w  %0000000000000000,%1100000000000011
  1668.    dc.w  %0000000000000000,%1100000000000011
  1669.    dc.w  %0000000000000000,%1100000000000011
  1670.    dc.w  %0000000000000000,%1100000000000011
  1671.    dc.w  %0000000000000000,%1111111111111111
  1672.    dc.w  %0000000000000000,%1111111111111111
  1673.    dc.w  0,0
  1674.  
  1675.  
  1676. square.2sprite
  1677.    dc.w  0,0
  1678.    dc.w  %0000000000000000,%1111111111111111
  1679.    dc.w  %0000000000000000,%1111111111111111
  1680.    dc.w  %0000000110000000,%1100000110000011
  1681.    dc.w  %0000000110000000,%1100000110000011
  1682.    dc.w  %0000000110000000,%1100000110000011
  1683.    dc.w  %0000000110000000,%1100000110000011
  1684.    dc.w  %0000000110000000,%1100000110000011
  1685.    dc.w  %0011111111111100,%1111111111111111
  1686.    dc.w  %0011111111111100,%1111111111111111
  1687.    dc.w  %0000000110000000,%1100000110000011
  1688.    dc.w  %0000000110000000,%1100000110000011
  1689.    dc.w  %0000000110000000,%1100000110000011
  1690.    dc.w  %0000000110000000,%1100000110000011
  1691.    dc.w  %0000000110000000,%1100000110000011
  1692.    dc.w  %0000000000000000,%1111111111111111
  1693.    dc.w  %0000000000000000,%1111111111111111
  1694.    dc.w  0,0
  1695.  
  1696.  
  1697. brush.sprite
  1698.    dc.w  0,0
  1699.    dc.w  %0000000000000000,%1111110000000000
  1700.    dc.w  %0000100000000000,%1111111100000000
  1701.    dc.w  %0000010000000000,%1111111111000000
  1702.    dc.w  %0000001000000000,%1111111111110000
  1703.    dc.w  %0000000100000000,%1111111111110000
  1704.    dc.w  %0000000100000000,%1111111111000000
  1705.    dc.w  %0000000100000000,%0011111111000000
  1706.    dc.w  %0000000000000000,%0000111111000000
  1707.    dc.w  %0000000000000000,%0000001110000000
  1708.    dc.w  %0000001000000000,%0000000111000000
  1709.    dc.w  %0000000100000000,%0000000011100000
  1710.    dc.w  %0000000010000000,%0000000001110000
  1711.    dc.w  %0000000001000000,%0000000000111000
  1712.    dc.w  %0000000000100000,%0000000000011100
  1713.    dc.w  %0000000000010000,%0000000000001110
  1714.    dc.w  %0000000000001000,%0000000000000111
  1715.    dc.w  0,0
  1716.  
  1717.  
  1718. brush.2sprite
  1719.    dc.w  0,0
  1720.    dc.w  %0000000000000000,%1110000000000000
  1721.    dc.w  %0001000000000000,%1111100000000000
  1722.    dc.w  %0000100000000000,%1111111000000000
  1723.    dc.w  %0000010000000000,%0111111111000000
  1724.    dc.w  %0000001000000000,%0111111111000000
  1725.    dc.w  %0000010000000000,%0011111110000000
  1726.    dc.w  %0000010000000000,%0000111110000000
  1727.    dc.w  %0000000000000000,%0000001100000000
  1728.    dc.w  %0000000000000000,%0000000110000000
  1729.    dc.w  %0000001000000000,%0000000011000000
  1730.    dc.w  %0000000100000000,%0000000001100000
  1731.    dc.w  %0000000010000000,%0000000000110000
  1732.    dc.w  %0000000001000000,%0000000000011000
  1733.    dc.w  %0000000000100000,%0000000000001100
  1734.    dc.w  %0000000000010000,%0000000000000110
  1735.    dc.w  %0000000000001000,%0000000000000011
  1736.    dc.w  0,0
  1737.  
  1738. funny.fill
  1739.    dc.w  %1111111111111111
  1740.    dc.w  %1111111111111111
  1741.    dc.w  %0000000000000000
  1742.    dc.w  %0000000000000000
  1743.  
  1744.    dc.w  %1100000000000000
  1745.    dc.w  %1100000000000000
  1746.    dc.w  %1100001100110011
  1747.    dc.w  %1100001100110011
  1748.  
  1749.    dc.w  %1100000011001100
  1750.    dc.w  %1100000011001100
  1751.    dc.w  %1100000011001111
  1752.    dc.w  %1100000011001111
  1753.  
  1754.    dc.w  %1100110000001100
  1755.    dc.w  %1100110000001100
  1756.    dc.w  %1100110000111100
  1757.    dc.w  %1100110000111100
  1758.  
  1759.    dc.w  %0000000000000000
  1760.    dc.w  %0000000000000000
  1761.    dc.w  %1111111111111111
  1762.    dc.w  %1111111111111111
  1763.  
  1764.    dc.w  %0000000011000000
  1765.    dc.w  %0000000011000000
  1766.    dc.w  %0000000000110000
  1767.    dc.w  %0000000000110000
  1768.  
  1769.  
  1770. funny.3fill
  1771.    dc.w  %1100000011000000
  1772.    dc.w  %0011000000110000
  1773.    dc.w  %0000110000001100
  1774.    dc.w  %0000001100000011
  1775.  
  1776. funny.2fill
  1777.    dc.w  %0000000011111111
  1778.    dc.w  %0000000011111111
  1779.    dc.w  %0000000011111111
  1780.    dc.w  %0000000011111111
  1781.  
  1782.    dc.w  %0000111100001111
  1783.    dc.w  %0000111100001111
  1784.    dc.w  %0000111100001111
  1785.    dc.w  %0000111100001111
  1786.  
  1787.    dc.w  %0011001100110011
  1788.    dc.w  %0011001100110011
  1789.    dc.w  %0011001100110011
  1790.    dc.w  %0011001100110011
  1791.  
  1792.    dc.w  %0101010101010101
  1793.    dc.w  %0101010101010101
  1794.    dc.w  %0101010101010101
  1795.    dc.w  %0101010101010101
  1796.  
  1797.  
  1798.    dc.w  %0000000000000000
  1799.    dc.w  %0000000000000000
  1800.    dc.w  %1111111111111111
  1801.    dc.w  %1111111111111111
  1802.  
  1803.    dc.w  %0000000000000000
  1804.    dc.w  %1111111111111111
  1805.    dc.w  %0000000000000000
  1806.    dc.w  %1111111111111111
  1807.  
  1808. line.sprite
  1809.    dc.w  0,0
  1810.    dc.w  %0000000000000000,%1000000000000000
  1811.    dc.w  %0000000000000000,%1110000000000000
  1812.    dc.w  %0000000000000000,%0111000000000000
  1813.    dc.w  %0000000000000000,%0011100000000000
  1814.    dc.w  %0000000000000000,%0001110000000000
  1815.    dc.w  %0000000000000000,%0000111000000000
  1816.    dc.w  %0000000000000000,%0000011100000000
  1817.    dc.w  %0000000000000000,%0000001110000000
  1818.    dc.w  %0000000000000000,%0000000111000000
  1819.    dc.w  %0000000000000000,%0000000011100000
  1820.    dc.w  %0000000000000000,%0000000001110000
  1821.    dc.w  %0000000000000000,%0000000000111000
  1822.    dc.w  %0000000000000000,%0000000000011100
  1823.    dc.w  %0000000000000000,%0000000000001110
  1824.    dc.w  %0000000000000000,%0000000000000111
  1825.    dc.w  %0000000000000000,%0000000000000000
  1826.    dc.w  0,0
  1827.  
  1828.  
  1829.  
  1830. funnydot.fill
  1831.    dc.w  %0000000000000000
  1832.    dc.w  %0000000000000000
  1833.    dc.w  %0000000011111111
  1834.    dc.w  %0000000011111111
  1835.  
  1836.    dc.w  %0000000000001111
  1837.    dc.w  %0000000000001111
  1838.    dc.w  %0000111100001111
  1839.    dc.w  %0000111100001111
  1840.  
  1841.    dc.w  %0000001100000011
  1842.    dc.w  %0000001100000011
  1843.    dc.w  %0011001100110011
  1844.    dc.w  %0011001100110011
  1845.  
  1846.    dc.w  %0001000100010001
  1847.    dc.w  %0001000100010001
  1848.    dc.w  %0101010101010101
  1849.    dc.w  %0101010101010101
  1850.  
  1851.  
  1852.    dc.w  %1100110000000000
  1853.    dc.w  %1100110000000000
  1854.    dc.w  %0000000000110000
  1855.    dc.w  %0000000000110000
  1856.  
  1857.    dc.w  %0000000000000000
  1858.    dc.w  %0000000000000000
  1859.    dc.w  %0011001100000011
  1860.    dc.w  %0011001100000011
  1861.  
  1862. line2.sprite
  1863.    dc.w  0,0
  1864.    dc.w  %0000000000000000,%1000000000000000
  1865.    dc.w  %0000000000000000,%1110000000000000
  1866.    dc.w  %0000000000000000,%0000000000000000
  1867.    dc.w  %0000000000000000,%0000000000000000
  1868.    dc.w  %0000000000000000,%0001110000000000
  1869.    dc.w  %0000000000000000,%0000111000000000
  1870.    dc.w  %0000000000000000,%0000000000000000
  1871.    dc.w  %0000000000000000,%0000000000000000
  1872.    dc.w  %0000000000000000,%0000000111000000
  1873.    dc.w  %0000000000000000,%0000000011100000
  1874.    dc.w  %0000000000000000,%0000000000000000
  1875.    dc.w  %0000000000000000,%0000000000000000
  1876.    dc.w  %0000000000000000,%0000000000011100
  1877.    dc.w  %0000000000000000,%0000000000001110
  1878.    dc.w  %0000000000000000,%0000000000000111
  1879.    dc.w  %0000000000000000,%0000000000000000
  1880.    dc.w  0,0
  1881.  
  1882.  
  1883. bline2.sprite
  1884.    dc.w  0,0
  1885.    dc.w  %0000000000000000,%1000000000000000
  1886.    dc.w  %0000000000000000,%1110000000000000
  1887.    dc.w  %0111000000000000,%0000000000000000
  1888.    dc.w  %0011100000000000,%0000000000000000
  1889.    dc.w  %0000000000000000,%0001110000000000
  1890.    dc.w  %0000000000000000,%0000111000000000
  1891.    dc.w  %0000011100000000,%0000000000000000
  1892.    dc.w  %0000001110000000,%0000000000000000
  1893.    dc.w  %0000000000000000,%0000000111000000
  1894.    dc.w  %0000000000000000,%0000000011100000
  1895.    dc.w  %0000000001110000,%0000000000000000
  1896.    dc.w  %0000000000111000,%0000000000000000
  1897.    dc.w  %0000000000000000,%0000000000011100
  1898.    dc.w  %0000000000000000,%0000000000001110
  1899.    dc.w  %0000000000000000,%0000000000000111
  1900.    dc.w  %0000000000000000,%0000000000000000
  1901.    dc.w  0,0
  1902.  
  1903.  
  1904.  
  1905.    dc.w  %1111111111111111
  1906.    dc.w  %1111111111111111
  1907.    dc.w  %0000000000000000
  1908.    dc.w  %0000000000000000
  1909. hbar.sprite
  1910.    dc.w  0,0
  1911.    dc.w  %0000000000000000,%1111111111111111
  1912.    dc.w  %0000000000000000,%1111111111111111
  1913.    dc.w  %0000000000000000,%0000000000000000
  1914.    dc.w  %0000000000000000,%0000000000000000
  1915.    dc.w  %0000000000000000,%1111111111111111
  1916.    dc.w  %0000000000000000,%1111111111111111
  1917.    dc.w  %0000000000000000,%0000000000000000
  1918.    dc.w  %0000000000000000,%0000000000000000
  1919.    dc.w  %0000000000000000,%1111111111111111
  1920.    dc.w  %0000000000000000,%1111111111111111
  1921.    dc.w  %0000000000000000,%0000000000000000
  1922.    dc.w  %0000000000000000,%0000000000000000
  1923.    dc.w  %0000000000000000,%1111111111111111
  1924.    dc.w  %0000000000000000,%1111111111111111
  1925.    dc.w  %0000000000000000,%0000000000000000
  1926.    dc.w  %0000000000000000,%0000000000000000
  1927.    dc.w  0,0
  1928.  
  1929.  
  1930.  · alternate hbar
  1931.  
  1932.    dc.w  %1111111111111111
  1933.    dc.w  %0000000000000000
  1934.    dc.w  %1111111111111111
  1935.    dc.w  %0000000000000000
  1936. ahbar.sprite
  1937.    dc.w  0,0
  1938.    dc.w  %0000000000000000,%1111111111111111
  1939.    dc.w  %0000000000000000,%0000000000000000
  1940.    dc.w  %0000000000000000,%1111111111111111
  1941.    dc.w  %0000000000000000,%0000000000000000
  1942.    dc.w  %0000000000000000,%1111111111111111
  1943.    dc.w  %0000000000000000,%0000000000000000
  1944.    dc.w  %0000000000000000,%1111111111111111
  1945.    dc.w  %0000000000000000,%0000000000000000
  1946.    dc.w  %0000000000000000,%1111111111111111
  1947.    dc.w  %0000000000000000,%0000000000000000
  1948.    dc.w  %0000000000000000,%1111111111111111
  1949.    dc.w  %0000000000000000,%0000000000000000
  1950.    dc.w  %0000000000000000,%1111111111111111
  1951.    dc.w  %0000000000000000,%0000000000000000
  1952.    dc.w  %0000000000000000,%1111111111111111
  1953.    dc.w  %0000000000000000,%0000000000000000
  1954.    dc.w  0,0
  1955.  
  1956.    dc.w  %1100110011001100
  1957.    dc.w  %1100110011001100
  1958.    dc.w  %1100110011001100
  1959.    dc.w  %1100110011001100
  1960. vbar.sprite
  1961.    dc.w  0,0
  1962.    dc.w  %0000000000000000,%1100110011001100
  1963.    dc.w  %0000000000000000,%1100110011001100
  1964.    dc.w  %0000000000000000,%1100110011001100
  1965.    dc.w  %0000000000000000,%1100110011001100
  1966.    dc.w  %0000000000000000,%1100110011001100
  1967.    dc.w  %0000000000000000,%1100110011001100
  1968.    dc.w  %0000000000000000,%1100110011001100
  1969.    dc.w  %0000000000000000,%1100110011001100
  1970.    dc.w  %0000000000000000,%1100110011001100
  1971.    dc.w  %0000000000000000,%1100110011001100
  1972.    dc.w  %0000000000000000,%1100110011001100
  1973.    dc.w  %0000000000000000,%1100110011001100
  1974.    dc.w  %0000000000000000,%1100110011001100
  1975.    dc.w  %0000000000000000,%1100110011001100
  1976.    dc.w  %0000000000000000,%1100110011001100
  1977.    dc.w  %0000000000000000,%1100110011001100
  1978.    dc.w  0,0
  1979.  
  1980. · alternate vbar
  1981.  
  1982.    dc.w  %1010101010101010
  1983.    dc.w  %1010101010101010
  1984.    dc.w  %1010101010101010
  1985.    dc.w  %1010101010101010
  1986. avbar.sprite
  1987.    dc.w  0,0
  1988.    dc.w  %0000000000000000,%1010101010101010
  1989.    dc.w  %0000000000000000,%1010101010101010
  1990.    dc.w  %0000000000000000,%1010101010101010
  1991.    dc.w  %0000000000000000,%1010101010101010
  1992.    dc.w  %0000000000000000,%1010101010101010
  1993.    dc.w  %0000000000000000,%1010101010101010
  1994.    dc.w  %0000000000000000,%1010101010101010
  1995.    dc.w  %0000000000000000,%1010101010101010
  1996.    dc.w  %0000000000000000,%1010101010101010
  1997.    dc.w  %0000000000000000,%1010101010101010
  1998.    dc.w  %0000000000000000,%1010101010101010
  1999.    dc.w  %0000000000000000,%1010101010101010
  2000.    dc.w  %0000000000000000,%1010101010101010
  2001.    dc.w  %0000000000000000,%1010101010101010
  2002.    dc.w  %0000000000000000,%1010101010101010
  2003.    dc.w  %0000000000000000,%1010101010101010
  2004.    dc.w  0,0
  2005.  
  2006. · following sprites display background color
  2007.  
  2008. bhbar.sprite
  2009.    dc.w  0,0
  2010.    dc.w  %0000000000000000,%1111111111111111
  2011.    dc.w  %0000000000000000,%1111111111111111
  2012.    dc.w  %1111111111111111,%0000000000000000
  2013.    dc.w  %1111111111111111,%0000000000000000
  2014.    dc.w  %0000000000000000,%1111111111111111
  2015.    dc.w  %0000000000000000,%1111111111111111
  2016.    dc.w  %1111111111111111,%0000000000000000
  2017.    dc.w  %1111111111111111,%0000000000000000
  2018.    dc.w  %0000000000000000,%1111111111111111
  2019.    dc.w  %0000000000000000,%1111111111111111
  2020.    dc.w  %1111111111111111,%0000000000000000
  2021.    dc.w  %1111111111111111,%0000000000000000
  2022.    dc.w  %0000000000000000,%1111111111111111
  2023.    dc.w  %0000000000000000,%1111111111111111
  2024.    dc.w  %1111111111111111,%0000000000000000
  2025.    dc.w  %1111111111111111,%0000000000000000
  2026.    dc.w  0,0
  2027.  
  2028.  
  2029. bahbar.sprite
  2030.    dc.w  0,0
  2031.    dc.w  %0000000000000000,%1111111111111111
  2032.    dc.w  %1111111111111111,%0000000000000000
  2033.    dc.w  %0000000000000000,%1111111111111111
  2034.    dc.w  %1111111111111111,%0000000000000000
  2035.    dc.w  %0000000000000000,%1111111111111111
  2036.    dc.w  %1111111111111111,%0000000000000000
  2037.    dc.w  %0000000000000000,%1111111111111111
  2038.    dc.w  %1111111111111111,%0000000000000000
  2039.    dc.w  %0000000000000000,%1111111111111111
  2040.    dc.w  %1111111111111111,%0000000000000000
  2041.    dc.w  %0000000000000000,%1111111111111111
  2042.    dc.w  %1111111111111111,%0000000000000000
  2043.    dc.w  %0000000000000000,%1111111111111111
  2044.    dc.w  %1111111111111111,%0000000000000000
  2045.    dc.w  %0000000000000000,%1111111111111111
  2046.    dc.w  %1111111111111111,%0000000000000000
  2047.    dc.w  0,0
  2048.  
  2049. bvbar.sprite
  2050.    dc.w  0,0
  2051.    dc.w  %0011001100110011,%1100110011001100
  2052.    dc.w  %0011001100110011,%1100110011001100
  2053.    dc.w  %0011001100110011,%1100110011001100
  2054.    dc.w  %0011001100110011,%1100110011001100
  2055.    dc.w  %0011001100110011,%1100110011001100
  2056.    dc.w  %0011001100110011,%1100110011001100
  2057.    dc.w  %0011001100110011,%1100110011001100
  2058.    dc.w  %0011001100110011,%1100110011001100
  2059.    dc.w  %0011001100110011,%1100110011001100
  2060.    dc.w  %0011001100110011,%1100110011001100
  2061.    dc.w  %0011001100110011,%1100110011001100
  2062.    dc.w  %0011001100110011,%1100110011001100
  2063.    dc.w  %0011001100110011,%1100110011001100
  2064.    dc.w  %0011001100110011,%1100110011001100
  2065.    dc.w  %0011001100110011,%1100110011001100
  2066.    dc.w  %0011001100110011,%1100110011001100
  2067.    dc.w  0,0
  2068.  
  2069. bavbar.sprite
  2070.    dc.w  0,0
  2071.    dc.w  %0101010101010101,%1010101010101010
  2072.    dc.w  %0101010101010101,%1010101010101010
  2073.    dc.w  %0101010101010101,%1010101010101010
  2074.    dc.w  %0101010101010101,%1010101010101010
  2075.    dc.w  %0101010101010101,%1010101010101010
  2076.    dc.w  %0101010101010101,%1010101010101010
  2077.    dc.w  %0101010101010101,%1010101010101010
  2078.    dc.w  %0101010101010101,%1010101010101010
  2079.    dc.w  %0101010101010101,%1010101010101010
  2080.    dc.w  %0101010101010101,%1010101010101010
  2081.    dc.w  %0101010101010101,%1010101010101010
  2082.    dc.w  %0101010101010101,%1010101010101010
  2083.    dc.w  %0101010101010101,%1010101010101010
  2084.    dc.w  %0101010101010101,%1010101010101010
  2085.    dc.w  %0101010101010101,%1010101010101010
  2086.    dc.w  %0101010101010101,%1010101010101010
  2087.    dc.w  0,0
  2088.  
  2089. blt.pat
  2090.    dc.w  %0000000000000000
  2091.    dc.w  %0000000000000000
  2092.    dc.w  %0000000000000000
  2093.    dc.w  %0000000000000000
  2094.    dc.w  %0000000000000000
  2095.    dc.w  %0000001111000000
  2096.    dc.w  %0000011111100000
  2097.    dc.w  %0000111111110000
  2098.    dc.w  %0000111111110000
  2099.    dc.w  %0000011111100000
  2100.    dc.w  %0000001111000000
  2101.    dc.w  %0000000000000000
  2102.    dc.w  %0000000000000000
  2103.    dc.w  %0000000000000000
  2104.    dc.w  %0000000000000000
  2105.    dc.w  %0000000000000000
  2106.  
  2107. blt.2pat
  2108.    dc.w  %0000000000000000
  2109.    dc.w  %0000000000000000
  2110.    dc.w  %0000000000000000
  2111.    dc.w  %0000000000000000
  2112.    dc.w  %0000000000000000
  2113.    dc.w  %0000000000000000
  2114.    dc.w  %0000001111000000
  2115.    dc.w  %0000011111100000
  2116.    dc.w  %0000011111100000
  2117.    dc.w  %0000001111000000
  2118.    dc.w  %0000000000000000
  2119.    dc.w  %0000000000000000
  2120.    dc.w  %0000000000000000
  2121.    dc.w  %0000000000000000
  2122.    dc.w  %0000000000000000
  2123.    dc.w  %0000000000000000
  2124.  
  2125. blt.3pat
  2126.    dc.w  %0000000000000000
  2127.    dc.w  %0000011111100000
  2128.    dc.w  %0001111111111000
  2129.    dc.w  %0011111111111100
  2130.    dc.w  %0111111111111110
  2131.    dc.w  %0111111111111110
  2132.    dc.w  %1111111111111111
  2133.    dc.w  %1111111111111111
  2134.    dc.w  %1111111111111111
  2135.    dc.w  %1111111111111111
  2136.    dc.w  %0111111111111110
  2137.    dc.w  %0111111111111110
  2138.    dc.w  %0011111111111100
  2139.    dc.w  %0001111111111000
  2140.    dc.w  %0000011111100000
  2141.    dc.w  %0000000000000000
  2142.  
  2143. endofsprites
  2144.  
  2145.    section  one
  2146.  
  2147.  
  2148.  
  2149. --EQU statements for assembler
  2150. sysBase     equ   4
  2151. area.size   equ   200
  2152.  
  2153.  
  2154. --Macro definitions for assembler
  2155.  
  2156. lref  macro
  2157. _LVO\1      equ  -6*(\2+4)
  2158.       endm
  2159.  
  2160.  
  2161. callex macro
  2162.        a6.l  =  sysBase
  2163.        jsr    _LVO\1(A6)
  2164.        endm
  2165.  
  2166. calldos macro
  2167.        a6.l  =  dosbase
  2168.        jsr    _LVO\1(A6)
  2169.        endm
  2170.  
  2171. intuit macro
  2172.       a6.l   =  intuitionbase
  2173.       jsr    _LVO\1(A6)
  2174.       endm
  2175.  
  2176. graphics macro
  2177.       a6.l    =  graphicsbase
  2178.       a1.l    =  srastport
  2179.       jsr      _LVO\1(A6)
  2180.       endm
  2181.  
  2182. graph macro
  2183.       a6.l    =  graphicsbase
  2184.       jsr      _LVO\1(A6)
  2185.       endm
  2186.  
  2187. print macro
  2188.       a0     =  ^\1
  2189.       Show string
  2190.       endm
  2191.  
  2192. printerr macro
  2193.       a0     =  ^\1
  2194.       Display string
  2195.       endm
  2196.  
  2197. bstr  macro
  2198. \1    dc.b  1$-*-1
  2199.       dc.b  '\2',10
  2200. 1$
  2201.       endm
  2202.  
  2203.  
  2204.  
  2205. ¶ Following to avoid slow linking with amiga.lib
  2206.  
  2207. --Definitions of library references
  2208.  
  2209.       · Exec
  2210.    lref  Forbid,18
  2211.    lref  AllocMem,29
  2212.    lref  FreeMem,31
  2213.    lref  FindTask,45
  2214.    lref  Wait,49
  2215.  · lref  AllocSignal,51
  2216.  · lref  FreeSignal,52
  2217.  · lref  AddPort,55
  2218.  · lref  RemPort,56
  2219.    lref  GetMsg,58
  2220.    lref  ReplyMsg,59
  2221.    lref  WaitPort,60
  2222.  · lref  OpenDevice,70
  2223.  · lref  CloseDevice,71
  2224.  · lref  DoIO,72
  2225.  · lref  SendIO,73
  2226.    lref  OpenLibrary,88
  2227.  
  2228.       · AmigaDOS
  2229.    lref  Open,1
  2230.    lref  Close,2
  2231.    lref  Read,3
  2232.    lref  Write,4
  2233.    lref  Input,5
  2234.    lref  Output,6
  2235.  · lref  DeleteFile,8
  2236.    lref  CurrentDir,17
  2237.  · lref  IoErr,18
  2238.  · lref  LoadSeg,21
  2239.  · lref  UnLoadSeg,22
  2240.    lref  Delay,29
  2241.  · lref  IsInteractive,32
  2242.  
  2243.       · Intuition
  2244.    lref  ClearPointer,6
  2245.    lref  CloseScreen,7
  2246.    lref  CloseWindow,8
  2247.    lref  OpenScreen,29
  2248.    lref  OpenWindow,30
  2249.    lref  SetPointer,41
  2250.  
  2251.       · Graphics
  2252.    lref  BltBitMap,1
  2253.  · lref  ClearScreen,4
  2254.  · lref  TextLength,5
  2255.    lref  Text,6
  2256.    lref  SetFont,7
  2257.    lref  OpenFont,8
  2258.    lref  CloseFont,9
  2259.    lref  DrawEllipse,26
  2260.    lref  AreaEllipse,27
  2261.    lref  Move,36
  2262.    lref  Draw,37
  2263.    lref  AreaMove,38
  2264.    lref  AreaDraw,39
  2265.    lref  AreaEnd,40
  2266.    lref  WaitTOF,41
  2267.    lref  InitArea,43
  2268.    lref  SetRGB4,44
  2269.    lref  RectFill,47
  2270.    lref  BltPattern,48
  2271.    lref  WritePixel,50
  2272.  · lref  Flood,51
  2273.    lref  SetAPen,53
  2274.    lref  SetBPen,54
  2275.    lref  SetDrMd,55
  2276.    lref  InitBitMap,61
  2277.    lref  WaitBOVP,63
  2278.    lref  InitTmpRas,74
  2279.    lref  AllocRaster,78
  2280.    lref  FreeRaster,79
  2281.    lref  GetRGB4,93
  2282.    lref  ScrollVPort,94
  2283.  
  2284.